package com.samuel.springbootclidemo;


import com.samuel.spring_boot_starter_hello.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @date:2017/11/23
 * @time: 14:07
 * @author:zhaoyang
 * @desc:
 **/
@RestController
public class DemoController {

    @Autowired
    private HelloService helloService;

    @Value("${info.jrebel.name}")
    private String jrebel;

    @GetMapping(value = "/")
    public String index(){
        return "Hello,world!";

    }

    @GetMapping(value = "/hello")
    public String hello(){
        return helloService.sayHello();
    }

    @GetMapping(value = "/testJrebel")
    public String helloJrebel(){
        return "Hello"+jrebel;
    }
}
